package com.hzcx.app.simplechat.util;

import android.app.Activity;

import com.hzcx.app.simplechat.R;


/**
 * 动画工具类，方便override activity的动画
 *
 */
public class AnimUtil {

    /**
     * 把指定activity的打开动画换成默认的
     */
    public static void overrideCommonOpenAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_slide_right_in, R.anim.base_stack_push);
    }

    /**
     * 把指定activity的关闭动画换成默认的
     */
    public static void overrideCommonCloseAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_stack_pop, R.anim.base_slide_right_out);
    }

    /**
     * 把指定activity的打开动画换成从下往上滑入
     */
    public static void overrideSlideUpOpenAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_slide_up_enter, R.anim.base_do_nothing);
    }
    /**
     * 把指定activity的关闭动画换成从上往下滑出
     */
    public static void overrideSlideDownCloseAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_do_nothing, R.anim.base_slide_down_exit);
    }

    /**
     * 把指定activity的打开动画换成从右往左滑入
     */
    public static void overrideSlideRightOpenAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_slide_right_in, R.anim.base_do_nothing);
    }
    /**
     * 把指定activity的关闭动画换成从左往右滑出
     */
    public static void overrideSlideRightCloseAnimation(Activity activity) {
        activity.overridePendingTransition(R.anim.base_do_nothing, R.anim.base_slide_right_out);
    }


}
